Design Pattern: Bridge
Bridge is a structural design pattern that lets you split a large class or a set of closely related classes into two separate hierarchies - abstraction and implementation - which can be developed independently of each other.
Table of Contents
1. Design Pattern: Bridge
Suppose the implementation is hard yet the functionality is urgent, we can first design proper Abstraction that have the features required (feature1(), feature2(), feature3(), etc.) and a member pointing to the actual Implementation. The thing is that, external clients invokes only the features of Abstraction; while the definition of these features consists of methods from Implementation.
This could benefit, for example, cross-platform applications that for the Abstraction we provide same APIs so that the majority of app’s codebase remain unchanged, while we only need different ConcreteImplementation that implements the interface methods of Implementation.